<template>
  <div class="mx-container">
    <zz-sub-nav :list="list" :index.sync="index">
      <div class="sub-nav-content">
        <div class="clearfix">
          <div class="details-title">{{$t('zz.core_function')}}</div>
          <div class="coreFunction-card marginTop">
            <div class="coreFunctions">
              <h4>{{$t('zz.realTime.im.funtion.1.title')}}</h4>
              <p>{{$t('zz.realTime.im.funtion.1.des')}}</p>
            </div>
            <div class="coreFunctions">
              <h4>{{$t('zz.realTime.im.funtion.2.title')}}</h4>
              <p>{{$t('zz.realTime.im.funtion.2.des')}}</p>
            </div>
            <div class="coreFunctions">
              <h4>{{$t('zz.realTime.im.funtion.3.title')}}</h4>
              <p>{{$t('zz.realTime.im.funtion.3.des')}}</p>
            </div>
            <div class="coreFunctions">
              <h4>{{$t('zz.realTime.im.funtion.4.title')}}</h4>
              <p>{{$t('zz.realTime.im.funtion.4.des')}}</p>
            </div>
            <div class="coreFunctions">
              <h4>{{$t('zz.realTime.im.funtion.5.title')}}</h4>
              <p>{{$t('zz.realTime.im.funtion.5.des')}}</p>
            </div>
            <!-- <div class="coreFunctions">
              <h4>{{$t('zz.realTime.im.funtion.6.title')}}</h4>
              <p>{{$t('zz.realTime.im.funtion.6.des')}}</p>
            </div> -->
          </div>
        </div>
        <div>
          <div class="details-title">{{$t('zz.functional_characteristics')}}</div>
          <zz-card>
            <img src="@/assets/img/im/im2-1.png" alt="" width="520" slot="img">
            <!-- @/assets/img/live/live4-6.png -->
            <div slot="content">
              <ul class="list-has-poi">
                ''
                <li>{{$t('zz.realTime.im.funtionch.1')}}</li>
                <li>{{$t('zz.realTime.im.funtionch.2')}}</li>
                <li>{{$t('zz.realTime.im.funtionch.3')}}</li>
                <li>{{$t('zz.realTime.im.funtionch.4')}}</li>
              </ul>
            </div>
          </zz-card>
        </div>
        <div  style="min-height: 400px;">
          <div class="details-title">{{$t('zz.application_scenarios')}}</div>
          <div class="header-nav-wrapper-wrap">
            <ul class="header-nav-wrapper" style="width:650px;">
              <li
                v-for="(item, i) in list[2].child"
                :key="i"
                :class="item.index == subIndex ? 'active' : ''"
                @click="navClick(item)"
              >
                {{ item.name }}
              </li>
            </ul>
          </div>
          <div v-if="subIndex == 1" class="marginTop">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <ul class="list-has-poi">
                  <li>{{$t('zz.realTime.im.use.1.1')}}</li>
                  <li>{{$t('zz.realTime.im.use.1.2')}}</li>
                  <li>{{$t('zz.realTime.im.use.1.3')}}</li>
                  <li>{{$t('zz.realTime.im.use.1.4')}}</li>
                  <li>{{$t('zz.realTime.im.use.1.5')}}</li>
                  <li>{{$t('zz.realTime.im.use.1.6')}}</li>
                  <li>{{$t('zz.realTime.im.use.1.7')}}</li>
                </ul>
              </div>
              <img src="@/assets/img/im/im3-1.png" slot="img" alt="" width="380"/>
            </zz-card>
          </div>
          <div v-if="subIndex == 2" class="marginTop">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <ul class="list-has-poi">
                  <li>{{$t('zz.realTime.im.use.2.1')}}</li>
                  <li>{{$t('zz.realTime.im.use.2.2')}}</li>
                  <li>{{$t('zz.realTime.im.use.2.3')}}</li>
                  <li>{{$t('zz.realTime.im.use.2.4')}}</li>
                  <li>{{$t('zz.realTime.im.use.2.5')}}</li>
                  <li>{{$t('zz.realTime.im.use.2.6')}}</li>
                </ul>
              </div>
              <img src="@/assets/img/im/im3-2.png" slot="img" alt="" width="380"/>
            </zz-card>
          </div>
          <div v-if="subIndex == 3" class="marginTop">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <ul class="list-has-poi">
                  <li>{{$t('zz.realTime.im.use.3.1')}}</li>
                  <li>{{$t('zz.realTime.im.use.3.2')}}</li>
                  <li>{{$t('zz.realTime.im.use.3.3')}}</li>
                  <li>{{$t('zz.realTime.im.use.3.4')}}</li>
                  <li>{{$t('zz.realTime.im.use.3.5')}}</li>
                  <li>{{$t('zz.realTime.im.use.3.6')}}</li>
                </ul>
              </div>
              <img src="@/assets/img/im/im3-3.png" slot="img" alt="" width="380"/>
            </zz-card>
          </div>
          <div v-if="subIndex == 4" class="marginTop">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <ul class="list-has-poi">
                  <li>{{$t('zz.realTime.im.use.4.1')}}</li>
                  <li>{{$t('zz.realTime.im.use.4.2')}}</li>
                  <li>{{$t('zz.realTime.im.use.4.3')}}</li>
                  <li>{{$t('zz.realTime.im.use.4.4')}}</li>
                  <li>{{$t('zz.realTime.im.use.4.5')}}</li>
                  <li>{{$t('zz.realTime.im.use.4.6')}}</li>
                  <li>{{$t('zz.realTime.im.use.4.7')}}</li>
                </ul>
              </div>
              <img src="@/assets/img/im/im3-4.png" slot="img" alt="" width="380"/>
            </zz-card>
          </div>
          <div v-if="subIndex == 5" class="marginTop">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <ul class="list-has-poi">
                  <li>{{$t('zz.realTime.im.use.5.1')}}</li>
                  <li>{{$t('zz.realTime.im.use.5.2')}}</li>
                  <li>{{$t('zz.realTime.im.use.5.3')}}</li>
                  <li>{{$t('zz.realTime.im.use.5.4')}}</li>
                  <li>{{$t('zz.realTime.im.use.5.5')}}</li>
                  <li>{{$t('zz.realTime.im.use.5.6')}}</li>
                </ul>
              </div>
              <img src="@/assets/img/im/im3-5.png" slot="img" alt="" width="380"/>
            </zz-card>
          </div>
          <div v-if="subIndex == 6" class="marginTop">
            <zz-card position="left">
              <div slot="content" class="card-wrap">
                <ul class="list-has-poi">
                  <li>{{$t('zz.realTime.im.use.6.1')}}</li>
                  <li>{{$t('zz.realTime.im.use.6.2')}}</li>
                  <li>{{$t('zz.realTime.im.use.6.3')}}</li>
                  <li>{{$t('zz.realTime.im.use.6.4')}}</li>
                  <li>{{$t('zz.realTime.im.use.6.5')}}</li>
                </ul>
              </div>
              <img src="@/assets/img/im/im3-6.png" slot="img" alt="" width="380"/>
            </zz-card>
          </div>
        </div>
      </div>
    </zz-sub-nav>
  </div>
</template>

<script>
import SubNav from "@/components/SubNav/index.vue";
import ZzCard from "@/components/ZzCard";
import { mapGetters }from 'vuex'

export default {
  data() {
    return {
      index: 1,
      subIndex: 1,
      
    };
  },

  components: {
    "zz-sub-nav": SubNav,
    ZzCard,
  },
  props: {},
  mounted() {},
  computed: {
    activeItem: function () {
      let activeItem = this.list.find((v) => v.index == this.index);
      console.log(this.list[this.index]);
      this.subIndex = activeItem.child ? activeItem.child[0].index : 1;
      return activeItem;
    },
    ...mapGetters({
      isPC: 'isPC'
    }),
    list: function(){ return [
        { name: this.$t('zz.core_function'), index: 1, title: this.$t('zz.core_function') },
        { name: this.$t('zz.functional_characteristics'), index: 2, title: this.$t('zz.functional_characteristics') },
        {
          name: this.$t('zz.application_scenarios'),
          index: 3,
          child: [
            { name: this.$t('zz.realTime.im.use.6.1.title'), index: 1, pcname: this.$t('zz.realTime.im.use.6.1.title.little') },
            { name: this.$t('zz.realTime.im.use.6.2.title'), index: 2, pcname: this.$t('zz.realTime.im.use.6.2.title.little') },
            { name: this.$t('zz.realTime.im.use.6.3.title'), index: 3, pcname: this.$t('zz.realTime.im.use.6.3.title.little') },
            { name: this.$t('zz.realTime.im.use.6.4.title'), index: 4, pcname: this.$t('zz.realTime.im.use.6.4.title.little') },
            { name: this.$t('zz.realTime.im.use.6.5.title'), index: 5, pcname: this.$t('zz.realTime.im.use.6.5.title.little') },
            { name: this.$t('zz.realTime.im.use.6.6.title'), index: 6, pcname: this.$t('zz.realTime.im.use.6.6.title.little') },
          ],
        },
      ]},
  },
  watch: {},
  methods: {
    navClick(a_item) {
      console.log(a_item);
      this.subIndex = a_item.index;
    },
  },
  destroyed() {},
};
</script>
<style lang='scss' scoped>
@import "@/style/variables.scss";

.sub-nav-content {
  padding: 12px 48px;
  flex: 1;
  width: 100%;
  .pro-title {
    color: $color;
    font-size: 20px;
    padding: 20px 45px;
    border-bottom: 1px solid $border;
  }
  .pro-intro-wrap {
    padding: 30px 48px;
  }
  img {
    max-width: 100%;
  }
}
.son-pro-wrap {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  & > div {
    width: 238px;
  }
}
.pro-pailie-wrap {
  .card-wrap {
    margin-top: 30px;
    display: flex;
    flex-wrap: wrap;
    & > div {
      width: 40%;
      margin: 0 5% 30px;
      img {
        margin-top: 0;
        width: 32px;
        margin-right: 10px;
      }
      h6 {
        font-size: 18px;
        font-weight: normal;
        line-height: 32px;
        margin: 10px 0 15px;
      }
      p {
        font-size: 14px;
        line-height: 25px;
      }
    }
  }
}
.business-wrap {
  padding: 50px 25px;
  h6 {
    font-size: 16px;
    margin: 50px 0 25px;
  }
  ul {
    padding-left: 25px;
    li {
      color: rgba(59, 59, 59, 1);
      font-size: 14px;
      line-height: 200%;
    }
  }
  p {
    font-size: 14px;
  }
}
.clearfix:after{visibility:hidden;display:block;font-size:0;content: " ";clear:both;height:0;}   
.clearfix{*zoom:1;} 
.coreFunction-card {
  .coreFunctions {
    float: left;
    width: 31.3333%;
    margin: 0 3% 3% 0;
    min-height: 207px;
    padding-left: 95px;
    text-align: left;
    background-size: 66px 45px;
    background-repeat: no-repeat;
    background-position: 24px 35px;
    background-image: url("~@/assets/img/im/im1-1.png");
    &:nth-child(3n){
      margin-right:0;
    }
    &:nth-child(2){
      background-image: url("~@/assets/img/im/im1-2.png");
    }
    &:nth-child(3){
      background-image: url("~@/assets/img/im/im1-3.png");
    }
    &:nth-child(4){
      background-image: url("~@/assets/img/im/im1-4.png");
    }
    &:nth-child(5){
      background-image: url("~@/assets/img/im/im1-5.png");
    }
    &:nth-child(6){
      background-image: url("~@/assets/img/im/im1-6.png");
    }
    h4 {
      margin-top: 5px;
      font-size: 16px;
      line-height: 33px;
      font-weight: normal;
      color: #333;
    }
    p {
      font-size: 14px;
      line-height: 28px;
      color: #5c5f61bb;
      text-align: justify;
    }
  }
}

@media screen and (max-width:768px) {
  .coreFunction-card {
    .coreFunctions {
      width: 100%;
      min-height: 150px;
    }
  }
}

</style>